package com.wuxiaofan.member.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wuxiaofan.member.entity.MemberCollectSubject;
import com.wuxiaofan.member.entity.custom.MemberCollectSubjectCustom;
import com.wuxiaofan.member.mapper.MemberCollectSubjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wuxiaofan.member.client.Idgenerator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;

@Service
public class MemberCollectSubjectService {
    @Autowired
    private MemberCollectSubjectMapper umsMemberCollectSubjectMapper;
    @Resource
    private Idgenerator idgenerator;
    public MemberCollectSubject findById(String id){
        return umsMemberCollectSubjectMapper.selectById(id);
    }

    public MemberCollectSubjectCustom findCountByMap(Map paraMap){
        return umsMemberCollectSubjectMapper.findCountByMap(paraMap);
    }

    public MemberCollectSubjectCustom findGroupByMap(Map paraMap){
        return umsMemberCollectSubjectMapper.findGroupByMap(paraMap);
    }

    public List<MemberCollectSubjectCustom> findByMap(Map paraMap){
        return umsMemberCollectSubjectMapper.findByMap(paraMap);
    }

    public Page<MemberCollectSubjectCustom> findByMap(Map paraMap, Page page){
        return page.setRecords(umsMemberCollectSubjectMapper.findByMap(paraMap,page));
    }


    public void updateMapById(Map paraMap){
        umsMemberCollectSubjectMapper.updateMapById(paraMap);
    }
    public void delById(String id){
        umsMemberCollectSubjectMapper.deleteById(id);
    }

    public MemberCollectSubject save(MemberCollectSubject umsMemberCollectSubject){
        umsMemberCollectSubject.setId(idgenerator.getId());
        umsMemberCollectSubjectMapper.insert(umsMemberCollectSubject);
        return umsMemberCollectSubject;
    }

}
